#ifndef TCP_CLIENT_INCLUDED
#define TCP_CLIENT_INCLUDED

#include <string.h>
#include <stdio.h>
#include "ThreadService.h"
#include "com.pb.h"

using namespace std;


class clientTCP : public ThreadService
{
public:
	void processThreadProcess();
	clientTCP(std::string const& host, int port);
	bool sendString(com::Block const& block);
	virtual void receiveBlock(com::Block const& block)=0;

	void killTcpClient()
	{
		m_active = false;
	}

private:
	int m_listenFd;
	bool m_active;
	pthread_mutex_t m_send_block_mutex;
};

#endif
